<?php

namespace App\Controller\Admin;

use App\Controller\AbstractController;
use App\Support\Response;
use Hyperf\Di\Annotation\Inject;

class AdminBaseController extends AbstractController
{
    /**
     * @Inject()
     * @var Response
     */
    protected $response;


    public function guard()
    {
        return auth('jwt_admin');
    }

    public function uid(): int
    {
        $guard = $this->guard();
        return $guard->check() ? $guard->user()->getId() : 0;
    }

}